<%@Page Language="VB"%>
<%@ Register TagPrefix="Wrox" TagName="PageHeader" Src="/ch7/global/pageheader.ascx"%>
<%@ Register TagPrefix="Wrox" TagName="PageFooter" Src="/ch7/global/pagefooter.ascx"%>
<%@ Import Namespace="System.IO" %>


<Wrox:PageHeader id="header" runat=server />
<%

dim authors as string()  

redim authors(5)

authors(0) = "Richard"
authors(1) = "Alex"
authors(2) = "Dave"
authors(3) = "Karli"
authors(4) = "Brian"

dim e as IEnumerator

e = authors.GetEnumerator()

dim author as string
do While e.MoveNext() = true
	Response.Write("<P>" + e.Current )
	author = CType( e.Current, string )
Loop


for each author in authors
	Response.Write("<P>" + author)
next

'VB
if Array.IndexOf(authors, "Richard") <> -1  then
	Response.Write("<P>Richard is in the author list")
end if

'VB

dim index as integer
index = Array.IndexOf(authors,"Richard")
if index <> -1  then
    Response.Write("<P>" & authors(index) & " is in the author list")
end if


'VB

dim list as IList

list = CType(authors, IList)
if list.Contains("Richard") then
	index = list.IndexOf( "Richard")
    Response.Write("<P>" & list(index) & " is in the author list")
end if


dim movieList as IList

movieList = new ArrayList()
movieList.Add("Pulp Fiction")
movieList.Add("Aliens")

'VB
dim variedItems as ArrayList = new ArrayList()


variedItems.Add("Pulp Fiction")		' add a string
variedItems.Add(1234)				' add an integer
variedItems.Add(new ArrayList())	' add another array list



%>

</form>

<p style="color:red" id=status EnableViewState=False runat=server />
<Wrox:PageFooter id="footer" runat=server />